<template>
  <q-dialog v-model="innerDialogShow">
    <q-card style="">
      <q-card-section class="text-subtitle2">尽管反馈，我们会认真对待的！</q-card-section>
      <wang-editor v-model="articleContent" autofocus></wang-editor>
      <q-card-actions align="right">
        <q-btn class="q-mr-md" @click="innerDialogShow=false">取 消</q-btn>
        <q-btn @click="onSaveApp()">发 送</q-btn>
      </q-card-actions>
    </q-card>
  </q-dialog>
</template>

<script>
import dialog from 'src/mixins/form'
import { defineComponent, defineAsyncComponent } from 'vue'
import iUser from '../../api/user'

export default defineComponent({
  name: 'TheFeedbackManagement',
  mixins: [dialog],
  components: {
    WangEditor: defineAsyncComponent(() => import('src/components/wangEditor/WangEditor.vue'))
  },
  data () {
    return {
      articleContent: ''
    }
  },
  methods: {
    async onSaveApp () {
      if (this.articleContent === '') return
      await iUser.feedback({
        content: this.articleContent,
        status: 1
      })
      this.innerDialogShow = false
      this.articleContent = ''
      this.$q.notify({
        icon: 'insert_emoticon',
        message: '已收到，感谢你的反馈。',
        color: 'green',
        position: 'top',
        timeout: 800
      })
    }
  }
})
</script>

<style scoped>
</style>
